package leetcode.easy;

import leetcode.base.TreeNode;

/**
 * ClassName: $104_MaxDepth
 * Description:
 * date: 2021-11-17 22:49
 *
 * @author liyifan
 */
public class $104_MaxDepth {
    public int maxDepth(TreeNode root) {
        if (root == null)
            return 0;
        int left = maxDepth(root.left);
        int right = maxDepth(root.right);
        return Math.max(left, right) + 1;
    }
}
